home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.vars.gameon == 1)
- {
- quarter = _width / 4;
- leftpoint = 2 * quarter;
- rightpoint = 2 * quarter;
- if(key.isdown(key.LEFT))
- {
- if(1 + leftpoint < _X)
- {
- this._x -= eval("_root.vars.:boardmove");
- }
- else
- {
- this._x = 0 + rightpoint;
- }
- }
- if(key.isdown(key.RIGHT))
- {
- if(_X < 318 - rightpoint)
- {
- this._x += eval("_root.vars.:boardmove");
- }
- else
- {
- this._x = 319 - rightpoint;
- }
- }
- if(key.isdown(key.SPACE))
- {
- if(_root.vars.gun == 1 and _root.vars.bullet == 0)
- {
- _root.vars.bullet = 1;
- duplicateMovieClip(_root.bullet,"bullet1",18384);
- _root.bullet1._x = _X;
- _root.bullet1._y = _Y;
- }
- }
- if(key.isdown(key.SHIFT))
- {
- _root.vars.shiftpressed += 1;
- if(_root.vars.shiftpressed < 10)
- {
- _root.ball._x -= 4;
- }
- }
- if(this.hitTest(_root.ball))
- {
- if(_root.vars.fireball == 1)
- {
- _root.ball._y = _Y - 14;
- }
- else
- {
- _root.ball._y = _Y - 10;
- }
- if(_root.ball._x < _X and _X - quarter < _root.ball._x)
- {
- if(eval("_root.vars.:ballx") < 0)
- {
- set("_root.vars.:bally",-3.5);
- set("_root.vars.:ballx",-1.5);
- }
- else
- {
- set("_root.vars.:bally",-3.5);
- set("_root.vars.:ballx",-1.5);
- }
- }
- if(_X < _root.ball._x and _root.ball._x < _X + quarter)
- {
- if(eval("_root.vars.:ballx") < 0)
- {
- set("_root.vars.:bally",-3.5);
- set("_root.vars.:ballx",1.5);
- }
- else
- {
- set("_root.vars.:bally",-3.5);
- set("_root.vars.:ballx",1.5);
- }
- }
- if(_root.ball._x < _X - quarter)
- {
- if(eval("_root.vars.:ballx") < 0)
- {
- set("_root.vars.:ballx",-3);
- set("_root.vars.:bally",-3);
- }
- else
- {
- set("_root.vars.:ballx",-3);
- set("_root.vars.:bally",-3);
- }
- }
- if(_X + quarter < _root.ball._x)
- {
- if(eval("_root.vars.:ballx") < 0)
- {
- set("_root.vars.:ballx",3);
- set("_root.vars.:bally",-3);
- }
- else
- {
- set("_root.vars.:ballx",3);
- set("_root.vars.:bally",-3);
- }
- }
- _root.sounds.ballhitship_sfx.start(0.09,1);
- }
- }
- }
-